package com.trailwalker.javafx.utils.system;

/**
 * Created by jone.sun on 2016/11/15.
 */
public class OSUtils {
    public static final int WINDOWS = 1;
    public static final int LINUX = 2;
    public static final int MAC_OS = 3;
    public static final int OTHER_OS = 4;

    public static int getOS() {
        String var0 = System.getProperty("os.name").toLowerCase();
        return var0.contains("mac") ? 3 : var0.contains("linux") ? 2 : var0.contains("windows") ? 1 : 4;
    }

    public static String getOsArch() {
        return System.getProperty("os.arch");
    }

    public static boolean isX86(){
        String arch = System.getProperty("os.arch");
        if(arch.endsWith("32") || arch.endsWith("x86")) {
            return true;
        }
        return false;
    }

    public static String getOSName() {
        return System.getProperty("os.name");
    }

}
